{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "5852d813",
   "metadata": {},
   "source": [
    "作业要求以学号命名，类似\"123456.ipynb\"，不需要加姓名。\n",
    "\n",
    "\n",
    "作业提交的方式见下面链接：\n",
    "https://blog.csdn.net/sheagu/article/details/122397816"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5d3dca5a",
   "metadata": {},
   "source": [
    "## 题目一\n",
    "\n",
    "有一个这样的DNA核酸序列\n",
    "\n",
    "“AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC”\n",
    "\n",
    "请把这个核酸序列存入一个list，并数一数A、G、C、T各有多少个。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "e6521351",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'C': 12, 'G': 17, 'T': 21, 'A': 20}\n"
     ]
    }
   ],
   "source": [
    "# 你的代码\n",
    "lst = list(\"AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC\")\n",
    "s = set(lst)\n",
    "kys = s\n",
    "cnt = 0\n",
    "cntdict = dict.fromkeys(kys,cnt)\n",
    "for key in cntdict.keys():\n",
    "    cntdict[key] = lst.count(key)\n",
    "print(cntdict)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "daf8500d",
   "metadata": {},
   "source": [
    "## 题目二\n",
    "\n",
    "一个花样滑冰运动员表演后，裁判给表演内容进行评分，分数从0.25分到10分，每次增加值为0.25分。\n",
    "\n",
    "试生成一个元组，把可能的得分存入元组，并遍历元组的每一项，打印“一个运动员可能得_____分”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "90604ebb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "一个运动员可能得0.25分\n",
      "一个运动员可能得0.50分\n",
      "一个运动员可能得0.75分\n",
      "一个运动员可能得1.00分\n",
      "一个运动员可能得1.25分\n",
      "一个运动员可能得1.50分\n",
      "一个运动员可能得1.75分\n",
      "一个运动员可能得2.00分\n",
      "一个运动员可能得2.25分\n",
      "一个运动员可能得2.50分\n",
      "一个运动员可能得2.75分\n",
      "一个运动员可能得3.00分\n",
      "一个运动员可能得3.25分\n",
      "一个运动员可能得3.50分\n",
      "一个运动员可能得3.75分\n",
      "一个运动员可能得4.00分\n",
      "一个运动员可能得4.25分\n",
      "一个运动员可能得4.50分\n",
      "一个运动员可能得4.75分\n",
      "一个运动员可能得5.00分\n",
      "一个运动员可能得5.25分\n",
      "一个运动员可能得5.50分\n",
      "一个运动员可能得5.75分\n",
      "一个运动员可能得6.00分\n",
      "一个运动员可能得6.25分\n",
      "一个运动员可能得6.50分\n",
      "一个运动员可能得6.75分\n",
      "一个运动员可能得7.00分\n",
      "一个运动员可能得7.25分\n",
      "一个运动员可能得7.50分\n",
      "一个运动员可能得7.75分\n",
      "一个运动员可能得8.00分\n",
      "一个运动员可能得8.25分\n",
      "一个运动员可能得8.50分\n",
      "一个运动员可能得8.75分\n",
      "一个运动员可能得9.00分\n",
      "一个运动员可能得9.25分\n",
      "一个运动员可能得9.50分\n",
      "一个运动员可能得9.75分\n",
      "一个运动员可能得10.00分\n"
     ]
    }
   ],
   "source": [
    "# 你的代码\n",
    "lst = list()\n",
    "low = 0.25\n",
    "while low <= 10:\n",
    "    lst.append(low)\n",
    "    low += 0.25\n",
    "tup = tuple(lst)\n",
    "for i in tup:\n",
    "    print(\"一个运动员可能得%.2f分\"%i)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0c3a4e99",
   "metadata": {},
   "source": [
    "## 题目三\n",
    "\n",
    "创建一个字典，列出你所了解的地域美食，比如{'肠粉':{'城市':'广州','原料':'米'}}。当然，你可以做的更丰富一些。\n",
    "最后遍历你熟悉的美食，打印出，类似如下的句子：“肠粉是广州的一种美食，它的主要原料是米”。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "b0026af6",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 你的代码\n",
    "food = ['肠粉','肉夹馍','烤冷面']\n",
    "info = [{'城市':'广州','原料':'米'},{'城市':'潼关','原料':'猪肉、面粉'},{'城市':'哈尔滨','原料':'面'}]\n",
    "dct = dict(zip(food,info))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "4c3a6bc9",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'肠粉': {'城市': '广州', '原料': '米'},\n",
       " '肉夹馍': {'城市': '潼关', '原料': '猪肉、面粉'},\n",
       " '烤冷面': {'城市': '哈尔滨', '原料': '面'}}"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dct"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "bd26e971",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "肠粉是广州的一种美食，它的主要原料是米\n",
      "肉夹馍是潼关的一种美食，它的主要原料是猪肉、面粉\n",
      "烤冷面是哈尔滨的一种美食，它的主要原料是面\n"
     ]
    }
   ],
   "source": [
    "for f in dct.keys():\n",
    "    print(\"{}是{}的一种美食，它的主要原料是{}\".format(f,dct[f]['城市'],dct[f]['原料']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c8c7c404",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
